﻿CREATE TABLE [IOUAPI].[IOUs] (
    [OweId]          INT             NOT NULL,
    [DebtorUserId]   INT             NOT NULL,
    [CreditorUserId] INT             NOT NULL,
    [CurrencyId]     INT             NOT NULL,
    [Amount]         DECIMAL (18, 4) NOT NULL,
    CONSTRAINT [PK_IOUs] PRIMARY KEY CLUSTERED ([OweId] ASC),
    CONSTRAINT [FK_IOUs_Users] FOREIGN KEY ([DebtorUserId]) REFERENCES [IOUAPI].[Users] ([UserId]),
    CONSTRAINT [FK_IOUs_Users1] FOREIGN KEY ([CreditorUserId]) REFERENCES [IOUAPI].[Users] ([UserId])
);

